package com.foreknow.elmboot_demo.mapper;

import com.foreknow.elmboot_demo.po.Orders;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface OrdersMapper {
    @Insert("insert into orders values(null,#{userId},#{businessId},#{orderDate},#{orderTotal},#{daId},#{orderState})")
    public int createOrders(Orders orders);

    @Update("update orders set orderState=#{orderState} where orderId=#{orderId}")
    public int updateOrders(Orders orders);

    public Orders getOrdersById(Integer orderId);

    public List<Orders> listOrdersByUserId(String userId);

}
